import time

import requests

from proxy_pool import ProxyPool

pool = ProxyPool(max_size=10)
# 添加初始代理
# 在请求中使用代理
proxy = pool.get_random_proxy()
proxy = pool.get_random_proxy()

proxy = pool.get_random_proxy()
proxy = pool.get_random_proxy()
if proxy:
    proxies = {
        # 'http': f'http://{proxy[0]}:{proxy[1]}',
        'https': f'https://{proxy[0]}'
    }
    response = requests.get('https://www.1lou.info/forum-2-723.htm?orderby=tid&digest=0', proxies=None, timeout=10)
    print(response)